Field of the Invention
The present invention relates to a technique for processing image data containing an alpha channel.
Description of the Related Art
In recent years, image data in the Portable Network Graphics (PNG) format has been becoming widely handled. The image data in the PNG format is bitmap image data containing, for each pixel, a color value (for example, a Red/Green/Blue (RGB) value) of a pixel, and an alpha value (an α value) that expresses opacity (transparency) of this pixel.
Image data containing a plurality of pixels each having an α value is rendered by alpha (α) blending when being rendered on a foreground (i.e., on top of a background). The α blending is a method that combines a pixel (or an image) having an opacity with another image based on this opacity. Rendering by a common type of the α blending is rendering processing that combines the color value held by the pixel to be rendered on the foreground with the color value held by the background pixel based on the α value of this foreground pixel (i.e., processing that calculates a weighted average of them). For example, if a transparent pixel (a pixel having an α value indicating that this pixel is transparent (completely transparent)) is rendered on the foreground, a pixel resulting from the rendering processing by the α blending has a color value held by the background pixel. On the other hand, for example, if an opaque pixel (a pixel having an α value indicating that this pixel is opaque (completely opaque)) is rendered on the foreground, a pixel resulting from the rendering processing by the α blending has a color value held by the foreground pixel.
The rendering processing by the α blending requires a large amount of calculation due to the above-described processing that combines the color values. Therefore, Japanese Patent Application Laid-Open No. 2006-244248 aims at speeding up the rendering by omitting the α blending for all pixels in image data, if the individual pixels contained in the image data are constituted by either the transparent pixels or the opaque pixels.
In other words, according to Japanese Patent Application Laid-Open No. 2006-244248, the α blending is omitted, if the image data is constituted by only the transparent pixels or only the opaque pixels.